package com.xiaofeng.pochi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaofeng.pochi.common.Page;
import com.xiaofeng.pochi.pojo.ShopProductCategory;
import com.xiaofeng.pochi.pojo.SysBanner;
import com.xiaofeng.pochi.pojo.vo.ShopProductCategoryVo;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 *
 * @Author: chc
 * @Date: 2022/08/08/22:50
 * @Description:
 */
@Component
public interface ShopProductCategoryMapper extends BaseMapper<ShopProductCategory> {

    /**
     * 添加
     *
     * @param shopProductCategory
     */
    void save(ShopProductCategory shopProductCategory);

    /**
     * 根据父级ID和名称查询
     *
     * @param shopProductCategory
     * @return
     */
    ShopProductCategory getByParentIdAndName(ShopProductCategory shopProductCategory);

    /**
     * 修改
     *
     * @param shopProductCategory
     */
    void update(ShopProductCategory shopProductCategory);

    /**
     * 根据id查询
     *
     * @param id
     * @return
     */
    ShopProductCategory get(Long id);

    /**
     * 根据id删除
     *
     * @param id
     */
    void delete(Long id);

    /**
     * 分页查询
     * @param page
     * @return
     */
    List<ShopProductCategory> getByPage(Page<ShopProductCategory> page);

    /**
     * 查询总数
     * @param page
     * @return
     */
    Integer countByPage(Page<ShopProductCategory> page);

    /**
     * 查询所有
     * @param
     * @return
     */
    List<ShopProductCategory> getAll();

    /**
     * 查询所有一级二级分类
     * @return
     */
    List<ShopProductCategory> getSelectTree();

    List<ShopProductCategory> getByIds(List<Long> categoryIds);

    /**
     * 获取所有二级分类
     * @return
     */
    List<ShopProductCategory> getAllSecond();

    List<ShopProductCategory> getAllTop();

    /**
     * 查询首页导航宫格
     * @return
     */
    List<ShopProductCategory> getNavList();


    /**
     * 根据父级ID查询
     * @param parentId
     * @return
     */
    List<ShopProductCategory> getByParentId(Long parentId);
}
